package com.study.manage.dal;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.study.manage.domain.EvaluateGroup;
import com.study.manage.domain.enumm.ReleaseState;


public interface EvaluateGroupRepository extends PagingAndSortingRepository<EvaluateGroup, Long> {

    @Query("select t from EvaluateGroup t where t.userOrganizaId=:userOrganizaId and t.state!=0 and (t.state=:state or :state=null)")
    Page<EvaluateGroup> findByUserOrganizaId(@Param("userOrganizaId") Long userOrganizaId, @Param("state") ReleaseState state, Pageable pageable);

}
